package com.lqd.demo.springboot;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.lqd.demo.springboot.bean.UserConfig;

@RestController
public class HelloWorld {
	
	@Value("${test.user}")
	private String name;
	@Value("${test.age}")
	private int age;
	
	@Autowired
	private UserConfig config;

	@RequestMapping("/hello6")
	public String hello6(){
		
		return "Hello world。。。! \n username:" + name +" ; age:" + age + ";"
				+ "\n other name:"+config.getName() + ";other.age:"+config.getAge();
	}
	
	@RequestMapping("/hello2")
	public String hello2(){
		
		return "Hello world! \n username:" + name +" ; age:" + age + ";"
				+ "\n other name:"+config.getName() + ";other.age:"+config.getAge();
	}
}
